package permission.role;

import course.group.Group;

public class TutorRole implements Role {
	
	private final Group GROUP;
	
	public TutorRole(Group group) {
		GROUP = group;
		
	}
	
	@Override
	public RoleType getRoleType() {
		return RoleType.TUTOR;
	}
	
	public Group getGroup() {
		return GROUP;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((GROUP == null) ? 0 : GROUP.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		TutorRole other = (TutorRole) obj;
		if (GROUP == null) {
			if (other.GROUP != null) {
				return false;
			}
		} else if (!GROUP.equals(other.GROUP)) {
			return false;
		}
		return true;
	}
}
